#coding=utf-8

import bottle
from bottle import static_file
import os

def killport(port):
    command="kill -9 $(netstat -nlp | grep :"+str(port)+" | awk '{print $7}' | awk -F'/' '{{ print $1 }}')"
    os.system(command)

killport(9580)

rt = os.getcwd()

@bottle.route('/')
def starfile():
    return static_file('index.html', root=rt)

@bottle.route('/<path:path>')
def starfile(path):
    return static_file(path, root=rt)
    
bottle.run(host='0.0.0.0', port=9580)